package com.wgts.wgts.tools;

import java.util.ArrayList;

public class ShopKeepHelper {

    private ArrayList<ShopKeepListenter> shopKeepListenters;

    private ShopKeepHelper(){
        shopKeepListenters = new ArrayList<>();
    }

    private static class SingletonHolder{
        private static final ShopKeepHelper _INSTANCE = new ShopKeepHelper();
    }

    public ShopKeepHelper getInstance(){
        return SingletonHolder._INSTANCE;
    }

    public void addKeepListener(ShopKeepListenter shopKeepListenter){
        shopKeepListenters.add(shopKeepListenter);
    }

    public void removeKeepListener(ShopKeepListenter shopKeepListenter){
        shopKeepListenters.remove(shopKeepListenter);
    }

    public void sendKeepToast(String title, String url){
        for(ShopKeepListenter shopKeepListenter : shopKeepListenters){
            if(shopKeepListenter != null){
                shopKeepListenter.keepTost(title, url);
            }
        }
    }


}
